/**
 * @功能描述: 通用方法
 * @author: lzn
 * @date: 2022-09-20 18:42:53
 * @version: 1.0
 */
@import '../variable';

// 给$block添加 $namespace-前缀。如$namespace:yw 则添加yw-的前缀
@mixin b($block) {
  $B: $namespace+'-'+$block !global;

  .#{$B} {
    @content;
  }
}

// 倒置当前选择器$ele以及父选择器的排列,父选择器必须是类选择器.
// 例如: .a { @include reverse(p) { color:red; }} => p.a {color:red;}
@mixin reverse($ele) {
  $currentSelector: '';
  @each $unit in $ele {
    $currentSelector: #{$currentSelector + $unit + & + ","};
  }
  @at-root {
    #{$currentSelector} {
      @content;
    }
  }
}